package com.yalemang.photovalut.base.widget

import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.RelativeLayout
import android.widget.TextView
import com.yalemang.photovalut.base.R


class TitleBar: RelativeLayout {

    lateinit var ivLeft: ImageView
    lateinit var ivCenter: ImageView
    lateinit var ivRight: ImageView
    lateinit var tvLeft: TextView
    lateinit var tvCenter: TextView
    lateinit var tvRight: TextView



    constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs){
        init()
    }
    constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(
        context,
        attrs,
        defStyleAttr
    ){
        init()
    }

    constructor(context: Context?) : super(context){
        init()
    }
    constructor(
        context: Context?,
        attrs: AttributeSet?,
        defStyleAttr: Int,
        defStyleRes: Int
    ) : super(context, attrs, defStyleAttr, defStyleRes){
        init()
    }

    private fun init(){
        LayoutInflater.from(context).inflate(R.layout.title_bar, this)

        ivLeft = findViewById(R.id.iv_left)
        ivLeft.setBackgroundResource(com.google.android.material.R.color.mtrl_btn_transparent_bg_color)
        ivRight = findViewById(R.id.iv_right)
        ivRight.setBackgroundResource(com.google.android.material.R.color.mtrl_btn_transparent_bg_color)
        tvLeft = findViewById(R.id.tv_left)
        tvRight = findViewById(R.id.tv_right)
        tvCenter = findViewById(R.id.tv_center)
        ivCenter = findViewById(R.id.iv_center)
    }

    fun setLeftClickListener(onClickListener: OnClickListener){

    }

    fun setRightClickListener(onClickListener: OnClickListener){

    }
}